Repository navigation
DEV-1115 Exclude JNA from the driver on Android - #127
Merged
Merged
Conversation
shimmerdriver gained net.java.dev.jna:jna and jna-platform 5.18.1 in April (97bd44ab in Shimmer-Java-Android-API) for the desktop USB debug listeners, and 0.11.8_beta onwards carries them. Android had only ever built against 0.11.7_beta, so nothing saw it until now: against 0.11.9_beta every app fails packaging with "2 files found with path 'META-INF/AL2.0'" from the two JNA jars. A release with the driver box blank would stop at "Build every example against the chosen driver". JNA is desktop-only and nothing on Android loads those classes, so exclude it, as io.netty already is. Checked locally (JDK 17): with -PdriverVersion=0.11.9_beta the release .aar and assembleDebug in all 12 modules build; with the default driver (0.11.7_beta) all 12 still build. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Add JNA exclusion guidance to the generated release notes or consumer documentation.
1 open issue
What changed in this PR
This pull request prevents Android packaging conflicts with newer drivers by excluding desktop-only JNA dependencies.
Changes:
- Excludes
net.java.dev.jnafrom both driver dependencies.
| File | Description |
|---|---|
ShimmerAndroidInstrumentDriver/build.gradle |
Adds JNA exclusions for Android builds. |
Review effort: Lite
Excluding JNA in this repo's build.gradle does not reach apps that consume the published .aar: its POM lists no dependencies, so they add the driver themselves and would hit the same META-INF/AL2.0 clash with driver 0.11.8_beta or later. The generated notes now say to exclude net.java.dev.jna and link the exclusions this library builds with. Raised by the Copilot review on #127. Co-Authored-By: Claude Opus 5.5 <[email protected]>
JongChern
approved these changes
Oct 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Found while checking #123 against the new driver. This PR targets
DEV-1115_release_workflow, so merging it folds the fix into #123.The problem
A release with the driver box left blank now picks 0.11.9_beta. Against that driver, every example app fails packaging, so the release would stop at "Build every example against the chosen driver". It stops before anything is published, so that step did its job.
All 11 apps fail this way; only the library builds. #123's CI and dry runs never saw it, because they build against master's default driver,
0.11.7_beta.shimmerdrivergainedjnaandjna-platform5.18.1 in April (ShimmerResearch/Shimmer-Java-Android-API@97bd44ab), for the desktop USB debug listeners (UsbDebugListenerWindows/UsbDebugListenerMacOS). Every driver from 0.11.8_beta on carries them. Android never built against 0.11.8_beta, because itsshimmerbluetoothmanagerwas never published.Fix
Exclude
net.java.dev.jnafrom both driver dependencies in the rootbuild.gradle, asio.nettyalready is. JNA is desktop-only, and nothing on Android loads those classes.Tested locally (JDK 17, Gradle 8.5,
-Xmx4g)-PdriverVersion=0.11.9_beta: 11 of 12 modules fail, as above.-PdriverVersion=0.11.9_beta: the release.aarandassembleDebugin all 12 modules build.0.11.7_beta: all 12 modules still build.For the release notes
The published
.aar's POM lists no dependencies, so apps add the driver themselves. Apps using driver 0.11.8_beta or later will need the sameexclude group: 'net.java.dev.jna'. It would be worth adding a line about it to the release notes the workflow writes.🤖 Generated with Claude Code